---------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  H:\Dropbox\office\choice\stata\for restat\1_data_manipulation.log
  log type:  text
 opened on:  14 May 2012, 12:29:43
Analysis do-file 1_data_manipulation run on 14 May 2012 at 12:29:43

. set mem 20m

Current memory allocation

                    current                                 memory usage
    settable          value     description                 (1M = 1024k)
    --------------------------------------------------------------------
    set maxvar         5000     max. variables allowed           1.947M
    set memory           20M    max. data space                 20.000M
    set matsize         400     max. RHS vars in models          1.254M
                                                            -----------
                                                                23.201M

. set more off

. set rmsg on
r; t=0.00 12:29:43

. 
. ******************data organization**************************
. *****************get all experiments in one data file********
. 
. 
. ****************************************************
. clear
r; t=0.00 12:29:43

. 
. *main experiment
. insheet using main_experiment_raw_data.csv
(50 vars, 127 obs)
r; t=0.03 12:29:43

. 
. *experiment 1 is the main experiment
. gen experiment=1
r; t=0.00 12:29:43

. label var experiment "Experiment identifier"
r; t=0.00 12:29:43

. 
. label var sexismale "Male dummy"
r; t=0.00 12:29:43

. 
. label var age "Age"
r; t=0.00 12:29:43

. 
. *define age groups
. gen agegroup=2
r; t=0.00 12:29:43

. replace agegroup=1 if age<41
(35 real changes made)
r; t=0.00 12:29:43

. replace agegroup=3 if age>60
(45 real changes made)
r; t=0.00 12:29:43

. label var agegroup "Age group"
r; t=0.00 12:29:43

. 
. *define education variables
. label define education 1 "Less than 9th grade" 2 "Grades 9-12, no diploma" 3 "High school" 4 "Som
> e college" 5 "Associate's degree" 6 "Bachelor's degree" 7 "Graduate or professional degree" 
r; t=0.00 12:29:43

. label values education education
r; t=0.00 12:29:43

. *these are not mutually exclusive education attainment variables
. gen edhigh=(education>=1)
r; t=0.00 12:29:43

. gen edsomecol=(education>3)
r; t=0.00 12:29:43

. gen edcolgrad=(education>5)
r; t=0.00 12:29:43

. gen edpost=(education==7)
r; t=0.00 12:29:43

. 
. *generate a total earnings variable
. gen total_earned=paid1+paid2+paid3+paid4+paid5+paid6+paid7+paid8+paid9
r; t=0.00 12:29:43

. 
. order id experiment opt1 opt2 opt3 opt4 opt5 opt6 opt7 opt8 opt9 pay1 pay2 pay3 pay4 pay5 pay6 pa
> y7 pay8 pay9 round_order1 round_order2 round_order3 round_order4 round_order5 round_order6 round_
> order7 round_order8 round_order9 time1 time2 time3 time4 time5 time6 time7 time8 time9 paid1 paid
> 2 paid3 paid4 paid5 paid6 paid7 paid8 paid9 total_earned sexismale age agegroup education edhigh 
> edsomecol edcolgrad edpost
r; t=0.03 12:29:43

. 
. **reshape into long format**
. reshape long opt pay round_order time paid, i(id) j(round)
(note: j = 1 2 3 4 5 6 7 8 9)

Data                               wide   ->   long
-----------------------------------------------------------------------------
Number of obs.                      127   ->    1143
Number of variables                  57   ->      18
j variable (9 values)                     ->   round
xij variables:
                     opt1 opt2 ... opt9   ->   opt
                     pay1 pay2 ... pay9   ->   pay
round_order1 round_order2 ... round_order9->   round_order
                  time1 time2 ... time9   ->   time
                  paid1 paid2 ... paid9   ->   paid
-----------------------------------------------------------------------------
r; t=0.47 12:29:43

. placevar round, after(experiment)
r; t=0.08 12:29:43

. 
. *add task characteristics for each round, the number of options and attributes 
. gen noptions=0
r; t=0.00 12:29:43

. replace noptions=2 if round==1
(127 real changes made)
r; t=0.00 12:29:43

. replace noptions=4 if round==2 | round==4 | round==6 | round==8
(508 real changes made)
r; t=0.00 12:29:43

. replace noptions=13 if round==3 | round==5 | round==7 | round==9
(508 real changes made)
r; t=0.00 12:29:43

. label var noptions "Number of options seen"
r; t=0.00 12:29:43

. 
. gen natt=0
r; t=0.00 12:29:43

. replace natt=3 if round==1
(127 real changes made)
r; t=0.00 12:29:43

. replace natt=6 if round==2 | round==3 | round==4 | round==5
(508 real changes made)
r; t=0.00 12:29:43

. replace natt=10 if round==6 | round==7 | round==8 | round==9
(508 real changes made)
r; t=0.00 12:29:43

. label var natt "Total attributes seen"
r; t=0.00 12:29:43

. 
. placevar noptions natt, after(round_order)
r; t=0.00 12:29:43

. 
. *generate dummies for the number of each the number of options seen and the number of attributes 
> seen
. tab noptions, gen(nopt_dum)

  Number of |
    options |
       seen |      Freq.     Percent        Cum.
------------+-----------------------------------
          2 |        127       11.11       11.11
          4 |        508       44.44       55.56
         13 |        508       44.44      100.00
------------+-----------------------------------
      Total |      1,143      100.00
r; t=0.00 12:29:43

. label var nopt_dum1 "2 option dummy"
r; t=0.00 12:29:43

. label var nopt_dum2 "4 option dummy"
r; t=0.00 12:29:43

. label var nopt_dum3 "13 option dummy"
r; t=0.00 12:29:43

. 
. tab natt, gen(tb)

      Total |
 attributes |
       seen |      Freq.     Percent        Cum.
------------+-----------------------------------
          3 |        127       11.11       11.11
          6 |        508       44.44       55.56
         10 |        508       44.44      100.00
------------+-----------------------------------
      Total |      1,143      100.00
r; t=0.00 12:29:43

. rename tb1 natt_dum2
r; t=0.00 12:29:43

. rename tb2 natt_dum3
r; t=0.00 12:29:43

. rename tb3 natt_dum4
r; t=0.00 12:29:43

. label var natt_dum2 "3 attribute dummy"
r; t=0.00 12:29:43

. label var natt_dum3 "6 attribute dummy"
r; t=0.00 12:29:43

. label var natt_dum4 "10 attribute dummy"
r; t=0.00 12:29:43

. 
. placevar nopt_dum1 nopt_dum2 nopt_dum3 natt_dum2 natt_dum3 natt_dum4, after(natt)
r; t=0.00 12:29:43

. 
. *add best and worst payoff and average payoff for every round
. gen best_opt=80 if round==1
(1016 missing values generated)
r; t=0.00 12:29:43

. replace best_opt=71 if round==2 | round==3 | round==4 | round==6 | round==7 | round==8
(762 real changes made)
r; t=0.00 12:29:43

. replace best_opt=96 if round==5 | round==9
(254 real changes made)
r; t=0.00 12:29:43

. 
. gen worst_opt=50 if round==1 | round==2 | round==6
(762 missing values generated)
r; t=0.00 12:29:43

. replace worst_opt=42 if round==3 | round==7
(254 real changes made)
r; t=0.00 12:29:43

. replace worst_opt=31 if round==4 | round==8
(254 real changes made)
r; t=0.00 12:29:43

. replace worst_opt=5 if round==5 | round==9
(254 real changes made)
r; t=0.00 12:29:43

. 
. gen average_payoff=65 if round==1
(1016 missing values generated)
r; t=0.00 12:29:43

. replace average_payoff=62.25 if round==2 | round==6
(254 real changes made)
r; t=0.00 12:29:43

. replace average_payoff=58.61538 if round==3 | round==7
(254 real changes made)
r; t=0.00 12:29:43

. replace average_payoff=52 if round==4 | round==8
(254 real changes made)
r; t=0.00 12:29:43

. replace average_payoff=55.53846 if round==5 | round==9
(254 real changes made)
r; t=0.00 12:29:43

. 
. *generate a dummy indicating optimal choice
. gen optimal=(opt==1)
r; t=0.00 12:29:43

. 
. *generate a dummy indicating the nearly optimal choice, within 10% of the optimal option
. gen temp=0.9*best_opt
r; t=0.00 12:29:43

. gen optimalten=(pay>=temp)
r; t=0.00 12:29:43

. drop temp
r; t=0.00 12:29:43

. 
. *adjust the id variable to allow additional experiments to be merged
. replace id=id+1000
(1143 real changes made)
r; t=0.00 12:29:43

. 
. *generate a mutually exclusive education attainment variable, along with corresponding dummy vari
> ables
. gen educ=0
r; t=0.00 12:29:43

. replace educ=1 if education<=3
(108 real changes made)
r; t=0.00 12:29:43

. replace educ=2 if education==4 | education==5
(522 real changes made)
r; t=0.00 12:29:43

. replace educ=3 if education==6
(297 real changes made)
r; t=0.00 12:29:43

. replace educ=4 if education==7
(216 real changes made)
r; t=0.00 12:29:43

. placevar educ, after(education)
r; t=0.00 12:29:43

. drop education edhigh edsomecol edcolgrad edpost
r; t=0.00 12:29:43

. rename educ education
r; t=0.00 12:29:43

. label drop education
r; t=0.00 12:29:43

. label define education 1 "High school" 2 "Some college" 3 "College" 4 "Postgraduate"
r; t=0.00 12:29:43

. label values education education
r; t=0.00 12:29:43

. gen edhigh=(education==1)
r; t=0.00 12:29:43

. gen edsomecol=(education==2)
r; t=0.00 12:29:43

. gen edcolgrad=(education==3)
r; t=0.00 12:29:43

. gen edpost=(education==4)
r; t=0.00 12:29:43

. label var edhigh "High school and less dummy"
r; t=0.00 12:29:43

. label var edsomecol "Some college (includes associate's) dummy"
r; t=0.00 12:29:43

. label var edcolgrad "College graduate dummy"
r; t=0.00 12:29:43

. label var edpost "Postgraduate dummy"
r; t=0.00 12:29:43

. label var education "Education level"
r; t=0.00 12:29:43

. placevar edhigh-edpost, after(education)
r; t=0.00 12:29:43

. 
. *generate a variable indicating whether the choice made in the practice round was optimal
. bys id: gen practice=optimal if round==1
(1016 missing values generated)
r; t=0.00 12:29:43

. bys id: egen test=max(practice)
r; t=0.16 12:29:44

. drop practice
r; t=0.00 12:29:44

. rename test practice
r; t=0.00 12:29:44

. bys id: gen tb=paid if round==1
(1016 missing values generated)
r; t=0.00 12:29:44

. bys id: egen earn_practice=max(tb)
r; t=0.00 12:29:44

. drop tb
r; t=0.00 12:29:44

. label var practice "Practice round dummy=1 if optimal chosen"
r; t=0.00 12:29:44

. label var earn_practice "Earned payment in practice round"
r; t=0.00 12:29:44

. placevar practice earn_practice, after(natt)
r; t=0.00 12:29:44

. 
. *generate a dummy for the different pdfs across the rounds/tasks
. gen pdf=0
r; t=0.00 12:29:44

. replace pdf=1 if round==2 | round==3 |round==6 | round==7
(508 real changes made)
r; t=0.00 12:29:44

. replace pdf=2 if round==4 | round==5 |round==8 | round==9
(508 real changes made)
r; t=0.00 12:29:44

. label var pdf "PDF identifier"
r; t=0.00 12:29:44

. 
. *define the extreme and even pdfs
. gen pdf_extreme=(pdf==2)
r; t=0.00 12:29:44

. gen pdf_even=(pdf==1)
r; t=0.00 12:29:44

. label var pdf_extreme "Extreme pdf dummy"
r; t=0.00 12:29:44

. label var pdf_even "Even pdf dummy"
r; t=0.00 12:29:44

. 
. label var opt "Option chosen"
r; t=0.00 12:29:44

. label var optimal "Dummy (=1) if optimal option chosen"
r; t=0.00 12:29:44

. label var optimalten "Dummy (=1) if chosen option within 10% of optimal"
r; t=0.00 12:29:44

. label var pay "Chosen option's payoff probability"
r; t=0.00 12:29:44

. label var round "Round"
r; t=0.00 12:29:44

. label var round_order "Order in which each round is seen"
r; t=0.00 12:29:44

. label var paid "Paid dummy=1 if paid"
r; t=0.00 12:29:44

. label var time "Time taken"
r; t=0.00 12:29:44

. label var total_earned "Total earnings"
r; t=0.00 12:29:44

. 
. save main, replace
(note: file main.dta not found)
file main.dta saved
r; t=0.00 12:29:44

. 
. 
. 
. 
. 
. ****************************************************
. 
. clear
r; t=0.00 12:29:44

. *high stakes experiment
. insheet using high_stakes_experiment_raw_data.csv
(25 vars, 63 obs)
r; t=0.02 12:29:44

. 
. gen experiment=2
r; t=0.00 12:29:44

. label var experiment "Experiment identifier"
r; t=0.00 12:29:44

. 
. label var sexismale "Male dummy"
r; t=0.00 12:29:44

. 
. label var age "Age"
r; t=0.00 12:29:44

. 
. *define age groups
. gen agegroup=2
r; t=0.00 12:29:44

. replace agegroup=1 if age<41
(32 real changes made)
r; t=0.00 12:29:44

. replace agegroup=3 if age>60
(31 real changes made)
r; t=0.00 12:29:44

. label var agegroup "Age group"
r; t=0.00 12:29:44

. 
. label define education 1 "Less than 9th grade" 2 "Grades 9-12, no diploma" 3 "High school" 4 "Som
> e college" 5 "Associate's degree" 6 "Bachelor's degree" 7 "Graduate or professional degree" 
r; t=0.00 12:29:44

. label values education education
r; t=0.00 12:29:44

. *these are not mutually exclusive education attainment variables
. gen edhigh=(education>2)
r; t=0.00 12:29:44

. gen edsomecol=(education>3)
r; t=0.00 12:29:44

. gen edcolgrad=(education>5)
r; t=0.00 12:29:44

. gen edpost=(education==7)
r; t=0.00 12:29:44

. 
. gen total_earned=paid2*10+paid5*10+paid7*10+paid8*10
r; t=0.00 12:29:44

. 
. order id experiment opt2 opt5 opt7 opt8 pay2 pay5 pay7 pay8 round_order2 round_order5 round_order
> 7 round_order8 time2 time5 time7 time8 paid2 paid5 paid7 paid8 total_earned sexismale age agegrou
> p education edhigh edsomecol edcolgrad edpost
r; t=0.00 12:29:44

. 
. **reshape into long format**
. 
. reshape long opt pay round_order time paid, i(id) j(round)
(note: j = 2 5 7 8)

Data                               wide   ->   long
-----------------------------------------------------------------------------
Number of obs.                       63   ->     252
Number of variables                  32   ->      18
j variable (4 values)                     ->   round
xij variables:
                     opt2 opt5 ... opt8   ->   opt
                     pay2 pay5 ... pay8   ->   pay
round_order2 round_order5 ... round_order8->   round_order
                  time2 time5 ... time8   ->   time
                  paid2 paid5 ... paid8   ->   paid
-----------------------------------------------------------------------------
r; t=0.05 12:29:44

. placevar round, after(experiment)
r; t=0.00 12:29:44

. 
. *add task characteristics for each round, the number of options and attributes 
. gen noptions=0
r; t=0.00 12:29:44

. replace noptions=4 if round==2 | round==8
(126 real changes made)
r; t=0.00 12:29:44

. replace noptions=13 if round==5 | round==7
(126 real changes made)
r; t=0.00 12:29:44

. label var noptions "Number of options seen"
r; t=0.00 12:29:44

. 
. gen natt=0
r; t=0.00 12:29:44

. replace natt=6 if round==2 | round==5
(126 real changes made)
r; t=0.00 12:29:44

. replace natt=10 if round==7 | round==8
(126 real changes made)
r; t=0.00 12:29:44

. label var natt "Total attributes seen"
r; t=0.00 12:29:44

. 
. placevar noptions natt, after(round_order)
r; t=0.00 12:29:44

. 
. *generate dummies for the number of each the number of options seen and the number of attributes 
> seen
. gen nopt_dum2=(noptions==4)
r; t=0.00 12:29:44

. gen nopt_dum3=(noptions==13)
r; t=0.00 12:29:44

. label var nopt_dum2 "4 option dummy"
r; t=0.00 12:29:44

. label var nopt_dum3 "13 option dummy"
r; t=0.00 12:29:44

. 
. gen natt_dum3=(natt==6)
r; t=0.00 12:29:44

. gen natt_dum4=(natt==10)
r; t=0.00 12:29:44

. label var natt_dum3 "6 attribute dummy"
r; t=0.00 12:29:44

. label var natt_dum4 "10 attribute dummy"
r; t=0.00 12:29:44

. 
. placevar nopt_dum2 nopt_dum3 natt_dum3 natt_dum4, after(natt)
r; t=0.00 12:29:44

. 
. *add best and worst payoff and average payoff for every round
. gen best_opt=71 if round==2 | round==7 | round==8
(63 missing values generated)
r; t=0.00 12:29:44

. replace best_opt=96 if round==5
(63 real changes made)
r; t=0.00 12:29:44

. 
. gen worst_opt=50 if round==2 
(189 missing values generated)
r; t=0.00 12:29:44

. replace worst_opt=42 if round==7
(63 real changes made)
r; t=0.00 12:29:44

. replace worst_opt=31 if round==8
(63 real changes made)
r; t=0.00 12:29:44

. replace worst_opt=5 if round==5
(63 real changes made)
r; t=0.00 12:29:44

. 
. gen average_payoff=62.25 if round==2 
(189 missing values generated)
r; t=0.00 12:29:44

. replace average_payoff=58.61538 if round==7
(63 real changes made)
r; t=0.00 12:29:44

. replace average_payoff=52 if round==8
(63 real changes made)
r; t=0.00 12:29:44

. replace average_payoff=55.53846 if round==5
(63 real changes made)
r; t=0.00 12:29:44

. 
. *generate a dummy indicating optimal choice
. gen optimal=(opt==1)
r; t=0.00 12:29:44

. 
. *generate a dummy indicating the nearly optimal choice, within 10% of the optimal option
. gen temp=0.9*best_opt
r; t=0.00 12:29:44

. gen optimalten=(pay>=temp)
r; t=0.00 12:29:44

. drop temp
r; t=0.00 12:29:44

. 
. replace id=id+2000
id was byte now int
(252 real changes made)
r; t=0.00 12:29:44

. 
. *generate a mutually exclusive education attainment variable, along with corresponding dummy vari
> ables
. gen educ=0
r; t=0.00 12:29:44

. replace educ=1 if education<=3
(44 real changes made)
r; t=0.00 12:29:44

. replace educ=2 if education==4 | education==5
(144 real changes made)
r; t=0.00 12:29:44

. replace educ=3 if education==6
(36 real changes made)
r; t=0.00 12:29:44

. replace educ=4 if education==7
(28 real changes made)
r; t=0.00 12:29:44

. placevar educ, after(education)
r; t=0.00 12:29:44

. drop education edhigh edsomecol edcolgrad edpost
r; t=0.00 12:29:44

. rename educ education
r; t=0.00 12:29:44

. label drop education
r; t=0.00 12:29:44

. label define education 1 "High school" 2 "Some college" 3 "College" 4 "Postgraduate"
r; t=0.00 12:29:44

. label values education education
r; t=0.00 12:29:44

. gen edhigh=(education==1)
r; t=0.00 12:29:44

. gen edsomecol=(education==2)
r; t=0.00 12:29:44

. gen edcolgrad=(education==3)
r; t=0.00 12:29:44

. gen edpost=(education==4)
r; t=0.00 12:29:44

. label var edhigh "High school and less dummy"
r; t=0.00 12:29:44

. label var edsomecol "Some college (includes associate's) dummy"
r; t=0.00 12:29:44

. label var edcolgrad "College graduate dummy"
r; t=0.00 12:29:44

. label var edpost "Postgraduate dummy"
r; t=0.00 12:29:44

. label var education "Education level"
r; t=0.00 12:29:44

. placevar edhigh-edpost, after(education)
r; t=0.00 12:29:44

. 
. *generate a dummy for the different pdfs across the rounds/tasks
. gen pdf=0
r; t=0.00 12:29:44

. replace pdf=1 if round==2 | round==3 |round==6 | round==7
(126 real changes made)
r; t=0.00 12:29:44

. replace pdf=2 if round==4 | round==5 |round==8 | round==9
(126 real changes made)
r; t=0.00 12:29:44

. label var pdf "PDF identifier"
r; t=0.00 12:29:44

. 
. *define the extreme and even pdfs
. gen pdf_extreme=(pdf==2)
r; t=0.00 12:29:44

. gen pdf_even=(pdf==1)
r; t=0.00 12:29:44

. label var pdf_extreme "Extreme pdf dummy"
r; t=0.00 12:29:44

. label var pdf_even "Even pdf dummy"
r; t=0.00 12:29:44

. 
. label var opt "Option chosen"
r; t=0.00 12:29:44

. label var optimal "Dummy (=1) if optimal option chosen"
r; t=0.00 12:29:44

. label var optimalten "Dummy (=1) if chosen option within 10% of optimal"
r; t=0.00 12:29:44

. label var pay "Chosen option's payoff probability"
r; t=0.00 12:29:44

. label var round "Round"
r; t=0.00 12:29:44

. label var round_order "Order in which each round is seen"
r; t=0.00 12:29:44

. label var paid "Paid dummy=1 if paid"
r; t=0.00 12:29:44

. label var time "Time taken"
r; t=0.00 12:29:44

. label var total_earned "Total earnings"
r; t=0.00 12:29:44

. 
. save high, replace
(note: file high.dta not found)
file high.dta saved
r; t=0.00 12:29:44

. 
. 
. use main, clear
r; t=0.00 12:29:44

. append using high
nopt_dum2 was byte now float
nopt_dum3 was byte now float
natt_dum3 was byte now float
natt_dum4 was byte now float
(label education already defined)
r; t=0.01 12:29:44

. 
. placevar  pdf-pdf_even, after(natt_dum4)
r; t=0.00 12:29:44

. 
. *generate a dummy for the high stakes experiment
. gen high_stakes=(experiment==2)
r; t=0.00 12:29:44

. 
. label define experiment 1 "Main" 2 "High stakes"
r; t=0.00 12:29:44

. label values experiment experiment
r; t=0.00 12:29:44

. 
. 
. 
. save choice_experiments, replace
file choice_experiments.dta saved
r; t=0.01 12:29:44

. 
. 
. 
. 
. ****************************************************************************
. ******************get into wide shape***************************************
. ***************used for sample mean test************************************
. ****************************************************************************
. 
. clear
r; t=0.00 12:29:44

. insheet using main_experiment_raw_data.csv
(50 vars, 127 obs)
r; t=0.01 12:29:44

. 
. gen experiment=1
r; t=0.00 12:29:44

. label var experiment "Experiment identifier"
r; t=0.00 12:29:44

. 
. replace id=id+1000
(127 real changes made)
r; t=0.00 12:29:44

. 
. *define age groups
. gen agegroup=2
r; t=0.00 12:29:44

. replace agegroup=1 if age<41
(35 real changes made)
r; t=0.00 12:29:44

. replace agegroup=3 if age>60
(45 real changes made)
r; t=0.00 12:29:44

. label var agegroup "Age group"
r; t=0.00 12:29:44

. 
. *define mutually exclusive education variables
. gen educ=0
r; t=0.00 12:29:44

. replace educ=1 if education<=3
(12 real changes made)
r; t=0.00 12:29:44

. replace educ=2 if education==4 | education==5
(58 real changes made)
r; t=0.00 12:29:44

. replace educ=3 if education==6
(33 real changes made)
r; t=0.00 12:29:44

. replace educ=4 if education==7
(24 real changes made)
r; t=0.00 12:29:44

. placevar educ, after(education)
r; t=0.00 12:29:44

. drop education 
r; t=0.00 12:29:44

. rename educ education
r; t=0.00 12:29:44

. label define education 1 "High school" 2 "Some college" 3 "College" 4 "Postgraduate"
r; t=0.00 12:29:44

. label values education education
r; t=0.00 12:29:44

. gen edhigh=(education==1)
r; t=0.00 12:29:44

. gen edsomecol=(education==2)
r; t=0.00 12:29:44

. gen edcolgrad=(education==3)
r; t=0.00 12:29:44

. gen edpost=(education==4)
r; t=0.00 12:29:44

. label var edhigh "High school and less dummy"
r; t=0.00 12:29:44

. label var edsomecol "Some college (includes associate's) dummy"
r; t=0.00 12:29:44

. label var edcolgrad "College graduate dummy"
r; t=0.00 12:29:44

. label var edpost "Postgraduate dummy"
r; t=0.00 12:29:44

. label var education "Education level"
r; t=0.00 12:29:44

. placevar edhigh-edpost, after(education)
r; t=0.00 12:29:44

. 
. save main_experiment_wide, replace
(note: file main_experiment_wide.dta not found)
file main_experiment_wide.dta saved
r; t=0.00 12:29:44

. 
. 
. clear
r; t=0.00 12:29:44

. insheet using high_stakes_experiment_raw_data.csv
(25 vars, 63 obs)
r; t=0.00 12:29:44

. 
. gen experiment=2
r; t=0.00 12:29:44

. label var experiment "Experiment identifier"
r; t=0.00 12:29:44

. 
. replace id=id+2000
id was byte now int
(63 real changes made)
r; t=0.00 12:29:44

. 
. *define age groups
. gen agegroup=2
r; t=0.00 12:29:44

. replace agegroup=1 if age<41
(32 real changes made)
r; t=0.00 12:29:44

. replace agegroup=3 if age>60
(31 real changes made)
r; t=0.00 12:29:44

. label var agegroup "Age group"
r; t=0.00 12:29:44

. 
. *define mutually exclusive education variables
. gen educ=0
r; t=0.00 12:29:44

. replace educ=1 if education<=3
(11 real changes made)
r; t=0.00 12:29:44

. replace educ=2 if education==4 | education==5
(36 real changes made)
r; t=0.00 12:29:44

. replace educ=3 if education==6
(9 real changes made)
r; t=0.00 12:29:44

. replace educ=4 if education==7
(7 real changes made)
r; t=0.00 12:29:44

. placevar educ, after(education)
r; t=0.00 12:29:44

. drop education 
r; t=0.00 12:29:44

. rename educ education
r; t=0.00 12:29:44

. label define education 1 "High school" 2 "Some college" 3 "College" 4 "Postgraduate"
r; t=0.00 12:29:44

. label values education education
r; t=0.00 12:29:44

. gen edhigh=(education==1)
r; t=0.00 12:29:44

. gen edsomecol=(education==2)
r; t=0.00 12:29:44

. gen edcolgrad=(education==3)
r; t=0.00 12:29:44

. gen edpost=(education==4)
r; t=0.00 12:29:44

. label var edhigh "High school and less dummy"
r; t=0.00 12:29:44

. label var edsomecol "Some college (includes associate's) dummy"
r; t=0.00 12:29:44

. label var edcolgrad "College graduate dummy"
r; t=0.00 12:29:44

. label var edpost "Postgraduate dummy"
r; t=0.00 12:29:44

. label var education "Education level"
r; t=0.00 12:29:44

. placevar edhigh-edpost, after(education)
r; t=0.00 12:29:44

. 
. save high_stakes_experiment_wide, replace
(note: file high_stakes_experiment_wide.dta not found)
file high_stakes_experiment_wide.dta saved
r; t=0.00 12:29:44

. 
. use main_experiment_wide, clear
r; t=0.00 12:29:44

. append using high_stakes_experiment_wide
(label education already defined)
r; t=0.00 12:29:44

. 
. label define experiment 1 "Main" 2 "High stakes"
r; t=0.00 12:29:44

. label values experiment experiment
r; t=0.00 12:29:44

. 
. save choice_experiments_wide, replace
file choice_experiments_wide.dta saved
r; t=0.01 12:29:44

. 
. 
. 
. 
end of do-file
      name:  <unnamed>
       log:  H:\Dropbox\office\choice\stata\for restat\1_data_manipulation.log
  log type:  text
 closed on:  14 May 2012, 12:29:44
---------------------------------------------------------------------------------------------------
